New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hunk memory system from server / replace Com_Error #155

Merged
merged 4 commits into from Jan 29, 2019

Conversation

Projects
None yet
2 participants
@slipher
Copy link
Contributor

slipher commented Jan 26, 2019

No description provided.

@slipher slipher force-pushed the slipher:serverhunk branch from a1df1a2 to ca773df Jan 27, 2019

@slipher

This comment has been minimized.

Copy link
Contributor Author

slipher commented Jan 27, 2019

It was broken but now it isn't.

@slipher slipher force-pushed the slipher:serverhunk branch from ca773df to ee9cfa2 Jan 27, 2019

svs.snapshotEntities = ( entityState_t * ) Hunk_Alloc( sizeof( entityState_t ) * svs.numSnapshotEntities, ha_pref::h_high );
// allocate the snapshot entities
free(svs.snapshotEntities);
svs.snapshotEntities = static_cast<entityState_t*>(calloc(svs.numSnapshotEntities, sizeof(entityState_t)));

This comment has been minimized.

@DolceTriade

DolceTriade Jan 28, 2019

Contributor

Please comment about the lifetime of the allocations.

This comment has been minimized.

@slipher

slipher Jan 28, 2019

Author Contributor

The lifetime was... it gets leaked when svs gets memset. I've changed it to use a unique_ptr and destroy svs instead of using memset.

@slipher slipher force-pushed the slipher:serverhunk branch from ee9cfa2 to 83be562 Jan 28, 2019

@DolceTriade
Copy link
Contributor

DolceTriade left a comment

Just one more optional nit.

@@ -754,14 +754,14 @@ void CL_FlushMemory()
if ( !com_sv_running->integer )
{
// clear the whole hunk
Hunk_Clear();
Hunk_ShutDownRandomStuffAndClear();

This comment has been minimized.

@DolceTriade

DolceTriade Jan 29, 2019

Contributor

heh, maybe rename it to ShutdownSubsystems() or something and don't have it call Hunk_Clear()... idk, this seems like a weird construct anyways.

This comment has been minimized.

@slipher

slipher Jan 29, 2019

Author Contributor

I'm hoping to do some more work on initialization and shutdown soon. In the meantime I like to give it a name that highlights the weirdness.

@slipher slipher merged commit f1ffca9 into DaemonEngine:master Jan 29, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@slipher slipher deleted the slipher:serverhunk branch Jan 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment