MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / debugmem_allocmem

Function debugmem_allocmem

src/debugmem.cpp:1021–1045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019// 1 = allocvec
1020
1021uaecptr debugmem_allocmem(int mode, uae_u32 size, uae_u32 flags, uae_u32 caller)
1022{
1023 if (!debugmem_bank.baseaddr || !size)
1024 return 0;
1025 if (flags & 2) // MEMF_CHIP?
1026 return 0;
1027 uae_u16 aflags = DEBUGMEM_READ | DEBUGMEM_WRITE;
1028 if (flags & 0x10000) // MEMF_CLEAR
1029 aflags |= DEBUGMEM_INITIALIZED;
1030 if (mode)
1031 size += 4;
1032 struct debugmemallocs *dm = debugmem_allocate(size, aflags, 0);
1033 if (!dm)
1034 return 0;
1035 dm->type = mode ? DEBUGALLOC_ALLOCVEC : DEBUGALLOC_ALLOCMEM;
1036 dm->pc = caller;
1037 dm->data = flags;
1038 debugreportalloc(dm);
1039 uaecptr mem = dm->start + debugmem_bank.start;
1040 if (mode) {
1041 put_long(mem, size);
1042 mem += 4;
1043 }
1044 return mem;
1045}
1046
1047uae_u32 debugmem_freemem(int mode, uaecptr addr, uae_u32 size, uae_u32 caller)
1048{

Callers 1

mousehack_doneFunction · 0.85

Calls 3

debugmem_allocateFunction · 0.85
debugreportallocFunction · 0.85
put_longFunction · 0.85

Tested by

no test coverage detected