Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 417 for Malloc (0.1 sec)

  1. src/cmd/cgo/internal/testerrors/testdata/malloc.go

    	// causes it to fail.
    	if runtime.GOOS == "dragonfly" {
    		size = C.size_t(0x7fffffff << (32 * (^uintptr(0) >> 63)))
    	}
    
    	p := C.malloc(size)
    	if p == nil {
    		fmt.Println("malloc: C.malloc returned nil")
    		// Just exit normally--the test script expects this
    		// program to crash, so exiting normally indicates failure.
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 766 bytes
    - Viewed (0)
  2. src/runtime/malloc.go

    			minSizeForMallocHeaderIsSizeClass = true
    			break
    		}
    	}
    	if !minSizeForMallocHeaderIsSizeClass {
    		throw("min size of malloc header is not a size class boundary")
    	}
    	// Check that the pointer bitmap for all small sizes without a malloc header
    	// fits in a word.
    	if minSizeForMallocHeader/goarch.PtrSize > 8*goarch.PtrSize {
    		throw("max pointer/scan bitmap size for headerless objects is too large")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  3. src/runtime/cgo/gcc_linux_amd64.c

    {
    	uintptr *pbounds;
    
    	/* The memory sanitizer distributed with versions of clang
    	   before 3.8 has a bug: if you call mmap before malloc, mmap
    	   may return an address that is later overwritten by the msan
    	   library.  Avoid this problem by forcing a call to malloc
    	   here, before we ever call malloc.
    
    	   This is only required for the memory sanitizer, so it's
    	   unfortunate that we always run it.  It should be possible
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 22:06:46 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  4. src/runtime/cgo/gcc_util.c

    	guards).
    	free(NULL) has a fast-path special case in TSAN, so it doesn't
    	trigger signal delivery.
    	free(malloc(0)) would work (triggering the interceptors in malloc), but
    	it also runs a bunch of user-supplied malloc hooks.
    
    	So we choose strncpy(_, _, 0): it requires an extra header,
    	but it's standard and should be very efficient.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 18:49:38 UTC 2017
    - 1.8K bytes
    - Viewed (0)
  5. src/runtime/cgo/gcc_linux_arm64.c

    {
    	uintptr *pbounds;
    
    	/* The memory sanitizer distributed with versions of clang
    	   before 3.8 has a bug: if you call mmap before malloc, mmap
    	   may return an address that is later overwritten by the msan
    	   library.  Avoid this problem by forcing a call to malloc
    	   here, before we ever call malloc.
    
    	   This is only required for the memory sanitizer, so it's
    	   unfortunate that we always run it.  It should be possible
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 22:06:46 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  6. src/runtime/testdata/testprogcgo/stackswitch.c

    	char *stack1 = malloc(STACK_SIZE);
    	if (stack1 == NULL) {
    		perror("malloc");
    		exit(1);
    	}
    
    	// Allocate the second stack before freeing the first to ensure we don't get
    	// the same address from malloc.
    	//
    	// Will be freed in stackSwitchThread2.
    	stack2 = malloc(STACK_SIZE);
    	if (stack1 == NULL) {
    		perror("malloc");
    		exit(1);
    	}
    
    	if (getcontext(&uctx_switch) == -1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 15:17:33 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testsanitizers/testdata/tsan4.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    // Check that calls to C.malloc/C.free do not trigger TSAN false
    // positive reports.
    
    // #cgo CFLAGS: -fsanitize=thread
    // #cgo LDFLAGS: -fsanitize=thread
    // #include <stdlib.h>
    import "C"
    
    import (
    	"runtime"
    	"sync"
    )
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 634 bytes
    - Viewed (0)
  8. src/runtime/testdata/testprogcgo/racesig.go

    //go:build unix
    // +build unix
    
    package main
    
    // Test that an external C thread that is calling malloc can be hit
    // with SIGCHLD signals. This used to fail when built with the race
    // detector, because in that case the signal handler would indirectly
    // call the C malloc function.
    
    /*
    #include <errno.h>
    #include <signal.h>
    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 01:46:05 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  9. src/cmd/cgo/internal/testsanitizers/testdata/tsan5.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    // Check that calls to C.malloc/C.free do not collide with the calls
    // made by the os/user package.
    
    // #cgo CFLAGS: -fsanitize=thread
    // #cgo LDFLAGS: -fsanitize=thread
    // #include <stdlib.h>
    import "C"
    
    import (
    	"fmt"
    	"os"
    	"os/user"
    	"runtime"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 927 bytes
    - Viewed (0)
  10. src/runtime/mklockrank.go

      reflectOffs,
      timer,
      traceStrings,
      userArenaState
    # Above MALLOC are things that can allocate memory.
    < MALLOC
    # Below MALLOC is the malloc implementation.
    < fin,
      spanSetSpine,
      mspanSpecial,
      traceTypeTab,
      MPROF;
    
    # We can acquire gcBitsArenas for pinner bits, and
    # it's guarded by mspanSpecial.
    MALLOC, mspanSpecial < gcBitsArenas;
    
    # Memory profiling
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 9.1K bytes
    - Viewed (0)
Back to top