- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 417 for Malloc (0.2 sec)
-
src/cmd/cgo/internal/swig/testdata/stdio/main.swig
/* A trivial example of wrapping a C library using SWIG. */ %{ #include <stdio.h> #include <stdlib.h> %} %typemap(gotype) const char * "string" %typemap(in) const char * %{ $1 = malloc($input.n + 1); memcpy($1, $input.p, $input.n); $1[$input.n] = '\0'; %} %typemap(freearg) const char * %{ free($1); %} FILE *fopen(const char *name, const char *mode); int fclose(FILE *);
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 12:00:07 UTC 2023 - 563 bytes - Viewed (0) -
tensorflow/c/eager/c_api_experimental.cc
} const void TFE_MonitoringStringGaugeCellValue( TFE_MonitoringStringGaugeCell* cell, TF_Buffer* buf) { tensorflow::string value = cell->cell.value(); void* data = tensorflow::port::Malloc(value.length()); value.copy(static_cast<char*>(data), value.length(), 0); buf->data = data; buf->length = value.length(); buf->data_deallocator = [](void* data, size_t length) { tensorflow::port::Free(data);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 11 23:52:39 UTC 2024 - 35.9K bytes - Viewed (0) -
src/runtime/runtime1.go
profstackdepth int32 // debug.malloc is used as a combined debug check // in the malloc function and should be set // if any of the below debug options is != 0. malloc bool inittrace int32 sbrk int32 // traceallocfree controls whether execution traces contain // detailed trace data about memory allocation. This value // affects debug.malloc only if it is != 0 and the execution
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 17:52:17 UTC 2024 - 19.3K bytes - Viewed (0) -
src/runtime/mcache.go
var emptymspan mspan func allocmcache() *mcache { var c *mcache systemstack(func() { lock(&mheap_.lock) c = (*mcache)(mheap_.cachealloc.alloc()) c.flushGen.Store(mheap_.sweepgen) unlock(&mheap_.lock) }) for i := range c.alloc { c.alloc[i] = &emptymspan } c.nextSample = nextSample() return c } // freemcache releases resources associated with this
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 10K bytes - Viewed (0) -
src/cmd/cgo/internal/testsanitizers/testdata/msan_fail.go
// license that can be found in the LICENSE file. package main /* #include <string.h> #include <stdint.h> #include <stdlib.h> void f(int32_t *p, int n) { int32_t * volatile q = (int32_t *)malloc(sizeof(int32_t) * n); memcpy(p, q, n * sizeof(*p)); free(q); } void g(int32_t *p, int n) { if (p[4] != 1) { // We shouldn't get here; msan should stop us first. exit(0); } } */
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 701 bytes - Viewed (0) -
src/cmd/cgo/out.go
const char *_cgoPREFIX_Cfunc_CString(struct __go_string s) { char *p = malloc(s.__length+1); if(p == NULL) runtime_throw("runtime: C malloc failed"); memmove(p, s.__data, s.__length); p[s.__length] = 0; return p; } void *_cgoPREFIX_Cfunc_CBytes(struct __go_open_array b) { char *p = malloc(b.__count); if(p == NULL) runtime_throw("runtime: C malloc failed"); memmove(p, b.__values, b.__count); return p;
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 29 16:41:10 UTC 2024 - 59.6K bytes - Viewed (0) -
src/syscall/mksysctl_openbsd.pl
# We then walk this MIB and create a flattened sysctl name to OID hash. # use strict; my $debug = 0; my %ctls = (); my @headers = qw ( sys/sysctl.h sys/socket.h sys/tty.h sys/malloc.h sys/mount.h sys/namei.h sys/sem.h sys/shm.h sys/vmmeter.h uvm/uvm_param.h uvm/uvm_swap_encrypt.h ddb/db_var.h net/if.h net/if_pfsync.h net/pipex.h netinet/in.h netinet/icmp_var.h
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 14 13:21:46 UTC 2018 - 5K bytes - Viewed (0) -
src/cmd/cgo/internal/testsanitizers/testdata/tsan15.go
static void *sendthr(void *arg) { pthread_t th = *(pthread_t*)arg; while (1) { int r = pthread_kill(th, SIGWINCH); if (r < 0) break; } return 0; } static void foo() { pthread_t *th = malloc(sizeof(pthread_t)); pthread_t th2; pthread_create(th, 0, thr, 0); pthread_create(&th2, 0, sendthr, th); pthread_join(*th, 0); } */ import "C" import ( "time" ) //export go_callback
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 06 21:14:49 UTC 2024 - 968 bytes - Viewed (0) -
src/cmd/cgo/internal/testsanitizers/testdata/tsan13.go
} static void* spin(void *arg) { size_t n; struct timeval tvstart, tvnow; int diff; void *prev; void *cur; prev = NULL; gettimeofday(&tvstart, NULL); for (n = 0; n < 1<<20; n++) { cur = malloc(n); free(prev); prev = cur; gettimeofday(&tvnow, NULL); diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec); // Profile frequency is 100Hz so we should definitely
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 11:59:56 UTC 2023 - 1.7K bytes - Viewed (0) -
src/runtime/os_aix.go
} //go:nosplit func semacreate(mp *m) { if mp.waitsema != 0 { return } var sem *semt // Call libc's malloc rather than malloc. This will // allocate space on the C heap. We can't call mallocgc // here because it could cause a deadlock. sem = (*semt)(malloc(unsafe.Sizeof(*sem))) if sem_init(sem, 0, 0) != 0 { throw("sem_init") } mp.waitsema = uintptr(unsafe.Pointer(sem)) } //go:nosplit
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 8.9K bytes - Viewed (0)