View Issue Details

IDProjectCategoryView StatusLast Update
00027593 - Current Dev ListMaintenancepublic2019-10-20 15:22
ReporterK7ZCZAssigned ToK7ZCZ 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version6.4.0.842 
Target VersionFixed in Version 
Summary0002759: Cleanup: remove use of bogus xmalloc / xfree macros
Description
Several applications declare and use macros for memory management, like this:

#define xmalloc(s) (LPBYTE)HeapAlloc(GetProcessHeap(),0,(s))
#define xfree(p)   HeapFree (GetProcessHeap(),0,(LPVOID)(p))


These macros are bad for all the reasons that macros are bad -- most notably, type safety here.

More importantly, these macros aren't necessary. It's better to use new/delete or malloc/free, as they provide advanatages in debugging and performance, and are closer to C++ consturcts for sensible object (rather than memory) usage.

There is some evidecne that these macros were hacked in to work around perceived problems in the heap implementation. In fact, the issues largely surround concurrency and correctless issues in our own code.
TagsNo tags attached.
ModuleAll
Sub-ModuleGeneral
TestingNot Started

Activities

K7ZCZ

2018-09-13 16:03

administrator   ~0006203

This checkin is made to the MikeB2 branch.
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/4348

Once this change is merged to the main branch, the fixes will be available to test.

K7ZCZ

2018-12-11 18:22

administrator   ~0006578

Some more progress here ...
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/4541

K7ZCZ

2018-12-12 09:14

administrator   ~0006585

A bit more progress with this checkin
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/4548

K7ZCZ

2019-10-20 15:22

administrator   ~0008879

Tiny progress here ...
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/5224

Issue History

Date Modified Username Field Change
2018-06-03 19:24 K7ZCZ New Issue
2018-09-13 16:03 K7ZCZ Note Added: 0006203
2018-09-13 17:31 K7ZCZ Assigned To => K7ZCZ
2018-09-13 17:31 K7ZCZ Status new => assigned
2018-12-11 18:22 K7ZCZ Note Added: 0006578
2018-12-12 09:14 K7ZCZ Note Added: 0006585
2019-10-20 15:22 K7ZCZ Note Added: 0008879