Replace new/delete calls for Block* with malloc and free
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
The change sits in the MemPoolT template, which allocates and frees its Block* objects with new and delete; start by reading its block allocation and teardown code in tinyxml2.h. The reporter's workaround swaps in malloc and free, but the thread does not settle whether that is the right fix or whether the real problem is destruction order with a custom global allocator. Before editing, confirm that direction with a maintainer. Done means the pool's block lifetime is correct under overridden operator new and delete, with the existing tests still passing.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello,
I am writing a program in which the new and delete operators are overloaded in order to use a custom allocator, and I found that the new and delete calls to allocate and deallocate memory for Block* in MemPoolT was causing several memory issues. I fixed these by replacing these with malloc() and free(). I'm not sure exactly why these issues were occurring.
EDIT: I believe this is because my allocator deconstructed the memory before the memory pool, meaning the memory pool was trying to deallocate memory that no longer exists
- Lenguaje dominante
- C++
- Estrellas
- 5.8k
- Forks
- 2k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de leethomason/tinyxml2
-
XMLNode::InsertAfterChild dereferences NULL when addThis is already afterThis's next siblingPosiblemente ocupada @zhouyunding la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
leethomason/tinyxml2#1101 ·
-
CDATA output containing ]]> is not well-formed XMLPosiblemente ocupada @bconnnnn la tomó hace 23 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
leethomason/tinyxml2#1097 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
leethomason/tinyxml2#923 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
leethomason/tinyxml2#914 ·
-
New release requestAbierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 15/100
leethomason/tinyxml2#1087 · 4 comentarios ·
Todos los issues de leethomason/tinyxml2
Issues similares
-
Issue-Bug Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/winget-cli#6645 ·
Los mantenedores suelen responder en 2 días
-
cleanup help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ESPresense/ESPresense#2602 ·
Los mantenedores suelen responder en 1 día
-
devex good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 3 días