Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[ENHANCEMENT]: Add option to separate container initialization from memory allocation

Abierto
#339 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
backend

Línea de trabajo

Comienza localizando el constructor del contenedor y la implementación de clear(), y luego sigue las rutas de acceso como insert(), find(), size() y ref(). Determina cómo debe representarse la inicialización diferida y qué accesores deben activarla. Se considera terminado cuando la asignación y la inicialización pueden separarse, mientras que cada primer uso observa de forma segura un contenedor inicializado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

type: feature request
Is your feature request related to a problem? Please describe.

Our current process involves memory allocation for a container within its constructor and instant initialization through the clear() function. This sequence happens immediately and is also enclosed within the constructor.

However, there are instances where it's beneficial to postpone the initialization step to a more appropriate time in the program flow.

Describe the solution you'd like

To facilitate this, we must implement a strategy allowing deferred initialization while ensuring the container is fully initialized before its first use. This is vital for maintaining data integrity and avoiding runtime errors.

One potential strategy could be an initialize-on-first-touch approach: Any function call that could potentially access the container's memory (like insert(), find(), size(), ref(), etc.) would first check a boolean member indicating whether the container has been initialized or not.

If the container is not yet initialized (i.e., the boolean is false), the clear() function would be invoked to initialize the container, thus ensuring it's ready for use.

Describe alternatives you've considered

No response

Additional context

No response

Lenguaje dominante
Cuda
Estrellas
671
Forks
122
Merge medio
4 d 19 h
PR fusionados (30 d)
10

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/cuCollections

Todos los issues de NVIDIA/cuCollections

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.